package io;

import java.io.Serializable;
import java.util.Arrays;

public class Student implements Serializable {
    private String name;
    private int age;
    private String gender;
    private     transient  String[]otherInfo;

    /**
     *  transient 此属性值会被忽略忽略不必要的属性值可以达到对象序列化瘦身的目的
     */
    public Student() {
    }

    public Student(String name, int age, String gender, String[] otherInfo) {
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.otherInfo = otherInfo;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", gender='" + gender + '\'' +
                ", otherInfo=" + Arrays.toString(otherInfo) +
                '}';
    }
}

